package src.Players;

import src.Main;
import src.World.ItemList;
import src.Util.*;

public class PlayerChecks {
    public Player p;
    public PlayerItems pi;
    public ItemList il;

    public PlayerChecks(Player _p) {
	p = _p;
    }

    public boolean fullPlayerInv(Player p) {
	if(p.items.length == 28) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasItem(Player p, int itemId) {	
	int i;
	itemId++;
	for (i = 0; i < p.items.length; i++) {
		if(p.items[i] == itemId) {
			return true;
		} else {
			continue;
		}
	}
	return false;
    }

    public boolean playerHasWeapon(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasWeaponArray(Player p, int[] itemIds) {
	int i;
	for (i = 0; i < itemIds.length; i++) {
		if(p.equipment[3] == itemIds[i]) {
			return true;
		} else {
			continue;
		}
	}
	return false;
    }

    public boolean playerHasHelmet(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasCape(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasShield(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasBoots(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasGloves(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasPlate(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasLegs(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasArrows(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasRing(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }

    public boolean playerHasNecklace(Player p, int itemId) {
	if(p.equipment[3] == itemId) {
		return true;
	} else {
		return false;
	}
    }
}